//
//  RecordTableViewCell.m
//  TenThousand
//
//  Created by 我的 on 16/6/22.
//  Copyright © 2016年 baixue. All rights reserved.
//

#import "RecordTableViewCell.h"

@implementation RecordTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        _timer = [[UILabel alloc] initWithFrame:CGRectMake(0, 5, Screen_Width/3+20, 40)];
        _money = [[UILabel alloc] initWithFrame:CGRectMake(10+Screen_Width/3 , 5,Screen_Width/3-10, 40)];
        _state = [[UILabel alloc] initWithFrame:CGRectMake(20+Screen_Width/3 *2, 5, Screen_Width/3-10, 40)];
        
        [self.contentView addSubview:_timer];
        [self.contentView addSubview:_money];
        [self.contentView addSubview:_state];
        
        _timer.text = @"  2016-02-13 11:30:21";
        _money.text = @"5000.00元";
        _state.text = @"充值成功";
        _state.textColor = [UIColor colorWithRed:0.93 green:0.34 blue:0.22 alpha:1.00];
        
        
        _timer.textAlignment = NSTextAlignmentCenter;
        _money.textAlignment = NSTextAlignmentRight;
        _state.textAlignment = NSTextAlignmentCenter;
        
        if (Screen_Width == 320) {
            _timer.font = [UIFont systemFontOfSize:12.0f];
            _money.font = [UIFont systemFontOfSize:12.0f];
            _state.font = [UIFont systemFontOfSize:12.0f];
        }else{
            _timer.font = [UIFont systemFontOfSize:14.0f];
            _money.font = [UIFont systemFontOfSize:14.0f];
            _state.font = [UIFont systemFontOfSize:14.0f];
            
        }
        
    }
    return self;
    
}

//cell赋值
- (void)setDataWithModel:(MoneyRecordModel *)model{
    _timer.text = [NSString stringWithFormat:@"%@", model.AddDate];
    _money.text = [NSString stringWithFormat:@"%.2f元", [model.Amount floatValue]];
    _state.text = [NSString stringWithFormat:@"%@",model.State];
    
}

@end
